#include "widget.h"
#include "ui_widget.h"
#include <QLabel>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    // 将label标签挂在对象树下
    QLabel *label = new QLabel(this);
    label->setText("这是一段字体");

    QFont font;
    font.setFamily("微软雅黑");
    font.setPixelSize(30);
    font.setBold(true);
    font.setItalic(true);
    font.setUnderline(true);
    font.setStrikeOut(true);

    label->setFont(font);

    ui->pushButton_yes->setToolTip("这是YES");
    ui->pushButton_yes->setToolTipDuration(3000);

    ui->pushButton_no->setToolTip("这是NO");
    ui->pushButton_no->setToolTipDuration(1000);

}

Widget::~Widget()
{
    delete ui;
}

